﻿cmake_minimum_required(VERSION 3.8)  
project(agv_calib_tools)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(ament_cmake REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Boost REQUIRED COMPONENTS thread)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(rosbag2 REQUIRED)
find_package(agv_srvs REQUIRED)
find_package(agv_msgs REQUIRED)
find_package(tf2 REQUIRED) 
find_package(tf2_ros REQUIRED)  
find_package(tf2_geometry_msgs REQUIRED)

include_directories(
  include
  ${Eigen3_INCLUDE_DIRS}
  ${Boost_INCLUDE_DIRS}
)

add_executable(agv_calib 
  src/node_main.cpp 
  src/odom_calib.cpp
)

ament_target_dependencies(agv_calib
  rclcpp
  sensor_msgs
  std_msgs
  geometry_msgs
  nav_msgs
  rosbag2
  agv_srvs
)

target_link_libraries(agv_calib
  ${Eigen3_LIBRARIES}
  ${Boost_LIBRARIES}
  tf2::tf2  
  tf2_ros::tf2_ros  
  tf2_geometry_msgs::tf2_geometry_msgs  
)

install(TARGETS agv_calib
  DESTINATION lib/${PROJECT_NAME}
)

install(DIRECTORY launch/
  DESTINATION share/${PROJECT_NAME}/launch
)

ament_export_include_directories(include)
ament_export_dependencies(
  rclcpp
  sensor_msgs
  std_msgs
  geometry_msgs
  nav_msgs
  rosbag2
  Eigen3
  Boost
)

ament_package()